//
//  SingleCard.m
//  UISegmentControl_test
//
//  Created by Mac on 2020/11/30.
//  Copyright © 2020年 Lorisyy. All rights reserved.
//

#import "SingleCard.h"

@implementation SingleCard

- (id)init{
    self = [super init];
    if (self){
        self->content = @"";
        self->name = @"";
        self->tags = @"";
        self->time = @"";
        self->imgNum = 0;
        self->likesNum = 0;
        self->commentsNum = 0;
        self->photos = [[NSMutableArray alloc] init];
    }
    return self;
}

- (NSString *)getTime{
    return self->time;
}
- (NSString *)getName{
    return self->name;
}
- (NSString *)getContent{
    return self->content;
}
- (NSString *)getTags{
    return self->tags;
}

- (int)getImgNum{
    return self->imgNum;
}
- (int)getLikesNum{
    return self->likesNum;
}
- (int)getCommentsNum{
    return self->commentsNum;
}

- (UIImage *)getImgByIndex:(int)i{
    return self->photos[i];
}

- (void)setImgNum:(int)n{
    self->imgNum = n;
}
- (void)setLikesNum:(int)n{
    self->likesNum = n;
}
- (void)setCommentsNum:(int)n{
    self->commentsNum = n;
}

- (void)setTime:(NSString *)t{
    self->time = t;
}
- (void)setName:(NSString *)n{
    self->name = n;
}
- (void)setContent:(NSString *)c{
    self->content = c;
}
- (void)setTags:(NSString *)ts {
    self->tags = ts;
}
- (void)setPhotos:(NSMutableArray *)photos{
    for (int i = 0; i < (int)photos.count; i++) [self->photos addObject:photos[i]];
    // renew the image number.
    self->imgNum = (int)photos.count;
}

@end
